package com.gxa.service.impl;

import com.gxa.mapper.Level2Mapper;
import com.gxa.pojo.Level2;
import com.gxa.service.Level2Service;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @program: saas
 * @description:
 * @author: Tirion
 * @create: 2020-09-25 10:52
 **/

@Service("level2Service")
public class Level2ServiceImpl implements Level2Service {

    @Resource
    Level2Mapper level2Mapper;

    @Override
    @Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT
            ,rollbackFor = Throwable.class)
    public int deleteByPrimaryKey(Integer id) {
        return level2Mapper.deleteByPrimaryKey(id);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT
            ,rollbackFor = Throwable.class)
    public int insertSelective(Level2 record) {
        return level2Mapper.insertSelective(record);
    }

    @Override
    @Transactional(propagation = Propagation.SUPPORTS,isolation = Isolation.DEFAULT
            ,rollbackFor = Throwable.class)
    public Level2 selectByPrimaryKey(Integer id) {
        return level2Mapper.selectByPrimaryKey(id);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT
            ,rollbackFor = Throwable.class)
    public int updateByPrimaryKeySelective(Level2 record) {
        return level2Mapper.updateByPrimaryKeySelective(record);
    }

    @Override
    @Transactional(propagation = Propagation.SUPPORTS,isolation = Isolation.DEFAULT
            ,rollbackFor = Throwable.class)
    public List<Level2> selectAll() {
        return level2Mapper.selectAll();
    }

    @Override
    @Transactional(propagation = Propagation.SUPPORTS,isolation = Isolation.DEFAULT
            ,rollbackFor = Throwable.class)
    public Level2 selectByName(String name) {
        return level2Mapper.selectByName(name);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT
            ,rollbackFor = Throwable.class)
    public Integer deleteBatch(List<Integer> arr) {
        return level2Mapper.deleteBatch(arr);
    }


}
